﻿using com.uplus.data;

namespace WebApi
{
    /// <summary>
    /// 业务处理基类
    /// </summary>
    public abstract partial class BizBase
    {
        /// <summary>
        /// 数据操作接口(基本信息获取)
        /// </summary>
        protected DAMsSql Da
        {
            get
            {
                DAMsSql da = new DAMsSql(DBMySql);
                return da;
            }
        }

        protected DAMySql Db
        {
            get
            {
                DAMySql db = new DAMySql(DBMySql);
                return db;
            }
        }
        /// <summary>
        /// GetDB
        /// </summary>
        /// <param name="dbCon"></param>
        /// <returns></returns>
        protected DAMsSql GetDB(string dbCon)
        {
            DAMsSql da = new DAMsSql(dbCon);
            return da;
        }

        /// <summary>
        /// GetValue
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="dbCon"></param>
        /// <param name="sql"></param>
        /// <returns></returns>
        public T GetValue<T>(string dbCon, string sql)
        {
            return GetDB(dbCon).GetValue<T>(sql, null);
        }
    }
}
